The present invention relates to scaling video generally and, more particularly, a system and/or method for implementing a vertical filter for scaling a video picture that manages bandwidth.
A vertical filter is used in, for example, an MPEG-2 video decoder to scale the video picture and reduce height of the video picture. After each input video frame is written into memory the video frame is scaled to a smaller size using the vertical filter. The filter reads a number of input video display lines from a linestore. As each new output line is calculated the filter needs some new input lines to be loaded into the linestore from the framestore memory. With the output picture at a quarter of the input size this requires four new input lines to be loaded from the framestore memory for each output line calculated. The new input lines require a large amount of memory bandwidth.
One aspect the of present invention provides a method of vertically scaling a video picture comprising, receiving and storing lines of a video frame of a video picture, (ii) reading lines of the frame into linestores, (iii) applying the lines to a vertical filter and (iv) providing an output video line as a function of the lines. Reading the lines of the frame into linestores comprises reading M lines of each successive Nth line of the frame lines into the linestores, the value of M being dependent on a preselectable scaling factor.
In one example, reading M lines into linestores comprises reading a selected number of each successive 2nd line of the frame lines into linestores. The method may further comprise (i) following generation of the output video line, reading a further X lines from the framestore into the linestores to provide a further set of M lines in the linestores, (ii) applying the M lines to the vertical filter and (iii) providing a further output video line as a function of the lines, where X may be a variable function of the scaling factor which is preselectable by a user and may be in the range 0.25 to 4.0.
The output video line is ideally a function of the lines in the linestores and of coefficients of the vertical filter. In a further preferred form of the invention applying the lines to a vertical filter and providing an output video line as a function of the lines comprises the steps of (i) applying a first data word of each the M lines of data in the linestores to the vertical filter and generating a first data word of the output line as a function thereof and (ii) repeating step (i) for successive data words in the M lines of data in the linestores to generate successive output line data words as a function thereof to form the output line. Each successive data word of the output line may be a function of the associated data word of lines in the linestores and of coefficients of the vertical filter.
In another aspect of the invention, an apparatus may provide vertically scaling of a video picture. The apparatus generally comprises a framestore, a plurality of linestores, a control circuit, and a vertical filter. The framestore may be configured to receive and store lines of a video frame of a video picture. The plurality of linestores may receive M lines from the frame store. The control circuit may be configure to control the reading of each Nth line of the frame lines into the linestores to provide the M lines. The value of M may be dependent on a preselectable scaling factor. The vertical filter may provide an output video line as a function of the M lines in the linestores.
In one example, the control circuit comprises an address generator for generating addresses of data in data lines in the frame store to be read into the linestores, the address generator comprises a controller and an incrementing circuit. The controller may be configured to generate the base address for the frame stored in the frame store and set the line address of each data line to be read into the linestores. The incrementing circuit may be configured to increment through the addresses for the line. The controller increments the line addresses to cause each Nth line of the frame lines to be read into the linestores, where the value of N is typically 1 or 2.
The vertical filter is operable (or configured) to (i) receive a first data word of each the M lines of data in the linestores and to generate a first data word of the output line as a function thereof, and (ii) to receive successive data words of the M lines of data in the linestores and generate successive output line data words as a function thereof to form the output line. The filter comprises a multiplier for multiplying each the word of the lines from the linestores by a coefficient of the filter.
The control circuit is configured, following generation of the output video line, to read a further X lines from the framestore into the linestores to provide a further set of M lines in the linestores, and the vertical filter is configured to provide a further output video line as a function of the further set of M lines.
The apparatus advantageously comprises input circuit configured to enable a user to set a scaling factor for the vertical filter, the value X being a variable function of the scaling factor. The scaling factor has a value in the range 0.25 to 4.0.
In one example, the control circuit includes a filter control circuit comprising: a phase accumulator; a summing circuit configured to sum a value representing the scaling factor and an output of the accumulator; a counter configured to store a count value. The summing circuit has a first output for applying a first value to an input of the accumulator and a second output for applying a second value to the counter. The first and second values are functions of the scaling factor value. The control circuit is configured to control the value of M in response to (or in dependence on) the counter count.
The objects, features and advantages of the present invention include providing an improved vertical filter and method of scaling a video picture.